package com.gupao.gupaoeduvippattern.javaBase.thread.day01;

/**
 * @author Administrator
 * @date 2020-12-04 14:48
 */
public class ThreadDemo2 {

    public static void main(String[] args) {
        MyThread2 t1 = new MyThread2("线程A");
        MyThread2 t2 = new MyThread2("线程B");
        t1.start();
        t2.start();
    }

}

class MyThread2 extends Thread{

    public MyThread2(String name){
        super(name);
    }

    public void run(){
        for(int i=1; i<=100; i++){
            System.out.println(getName()+"线程运行了"+ i +"次");
        }
    }

}
